//
//  GHSTabBarController.m
//  penzer
//
//  Created by 还带大道 on 2018/11/14.
//  Copyright © 2018年 caiyc. All rights reserved.
//

#import "GHSTabBarController.h"
#import "GHSNavigationController.h"
#import "GHSOrderViewController.h"
#import "GHSStockViewController.h"
#import "GHSFundsViewController.h"
#import "GHSAppealViewController.h"
#import "GHSMineViewController.h"


@interface GHSTabBarController ()

@end

@implementation GHSTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.customTabBar.item_font = [UIFont fontWithName:@"PingFang-SC-Medium" size:12];
    self.customTabBar.item_textColor_nomal = RZ_COLOR(133, 133, 133);
    self.customTabBar.item_textColor_selected = RZ_COLOR(93, 57, 186);
    [self setupAllChildViewController];
    
}



/**初始化所有子控制器*/
- (void)setupAllChildViewController
{
    //订单
    GHSOrderViewController *order = [GHSOrderViewController new];
    order.tabBarItem.tag = 0;
    [self childVC:order title:@"订单" imageName:@"组 588" selectedImageName:@"组 587"];
    
    //库存
    GHSStockViewController *stock = [GHSStockViewController new];
    stock.tabBarItem.tag = 1;
    [self childVC:stock title:@"库存" imageName:@"组 585" selectedImageName:@"组 586"];
    
    //资金
    GHSFundsViewController *funds = [GHSFundsViewController new];
    funds.tabBarItem.tag = 0;
    [self childVC:funds title:@"资金" imageName:@"组 581" selectedImageName:@"组 582"];
    
    //申诉
    GHSAppealViewController *appeal = [GHSAppealViewController new];
    appeal.tabBarItem.tag = 0;
    [self childVC:appeal title:@"申诉" imageName:@"组 584" selectedImageName:@"组 583"];
    
    //我的
    GHSMineViewController *mine = [GHSMineViewController new];
    mine.tabBarItem.tag = 0;
    [self childVC:mine title:@"我的" imageName:@"组 580" selectedImageName:@"组 579"];
    
}



- (void)childVC:(UIViewController *)vc title:(NSString *)title imageName:(NSString *)imageName selectedImageName:(NSString *)selectedImageName
{
    GHSNavigationController *nav = [[GHSNavigationController alloc] initWithRootViewController:vc];
    nav.navBarHairlineImageView.hidden = YES;
    [self setupChildViewController:nav title:title imageName:imageName selectedImageName:selectedImageName];
}

@end
